داستان آبیدیک

dotnet core


فارسی

1 کامپیوتر و شبکه:: dotnet core

hi and welcome to this new series where we are going to try and build a new version of the 2017 series that I made Called dumb at core angle of building web application series to software architecture right so what am I going to do here well I'm going to switch the good old tree let architecture that we used in the last series I made in 2017 I'm going to use a new architecture Called the onion architecture or also Called the clean architecture instead in this new series so it's going to be Pretty much the same domain the same application everything will look the same when we talk about domain but it'll be a new architecture so you guys can Kind of pick between two different architectures if you want to you have the good old tree layout architecture that everybody knows or you have the clean and the onion architecture that's kind of the new boy that's going to try and conquer the world right so now you Will have both choices now I feel the dotnet core framework and the power it has with dependency injection it makes Sense to start moving towards of Architect that that supports dependency injection and the things that we gain with dependency injection so that's kind of why I want to move over to the clean architecture and don't worry we'll dive Into what all of this is in next egg During this series right so whilst on The next video just explain what the architecture is all about but I also want to tell you guys before we start That this is actually a second part of this series is actually from the first Part is actually the c-sharp basic right here and that's the one that you should watch before you go and if you have no clue on how to start with Visual Studio and work with dotnet core and stuff like that there's just some basic information Right here so let's get started the next lesson where we'll kind of jumpinto some Microsoft stuff and explain to you The way that we moved from a good old tree layer architecture into maybe wanting a clean architecture instead so see you next have fun. so this lesson we're just going to start out by making a simple solution to kind of build our new architecture and just to kind of get you guys started now I'm inside Visual Studio community right here on the Mac you can do the same on the windows machine if you're in doubt on how to use creating solutions and work with projects go and watch the first series there's a lot of information there both for Mac and Windows so I'm going to go up here I'm going to say file I'm going to make a new solution I'm going to select the dotnet core app console application solution now if you can't find that maybe go down to that net core app down here and select console application in here and I'll say next I'm going to pick the Dotnet core - one in my case because that's the framework out there right now and I'm going to give the project name console app because this is going to be the console app from 2017 but that's not I don't want the prot solution name to be that I actually want the solution name to be c-sharp architect so this is just going to contain the old app that's what I'm going to put inside this project but the solution I'm going to build an entire solution with all the beautiful information now right here you can see how the project is going to look inside your actual folder there we go so now it's inside my cord which is just where I put all my different core projects and I'm going to keep the rest of it as it Is we're going to have it ignore file we're going to get a git version control so let's just create this right here there we go so now we have our new solution and remember the solution name should be this right make sure your solution name is actually this or something like it and the project name should be something like this they can't you shouldn't name your solution console app that's just stupid your solution should be something that you can use the name right so make sure that the solution name is actually correct now it opened the program for me right here which is the first program the actual code that's going to be executed when I run this console app right here now the first thing I want to do is kind of jump into my old github repo and steal the code from the program in there and I'm just going to do it Manually right here going to copy the program file we could have done this with git but that's for another series so I'm just going to grab all of this except I'm going to grab from program and downwards you byung-hyun be all the way down to this so let's just stop with the first Protein right here and that's going to be for the core entities because it's Just that simple so what I want to do is pretty much just Move the customer into its own project Instead of having that inside the UI project right here so I'm going to move This guy into a new project but since This is the first project that I want to Add I right-click right here I say add new project there we go I have to make a Choice right I can choose two different project types since this is not a UI Project I don't want to use any kind of console app or REST API or MVC application anything like that I'm just going to select something called a class library in the.net framework pretty much just a package now that package doesn't Know anything about user interfaces it doesn't know how to present the data to The user the idea with the class library Is just that it's a package that can handle some data work some data do something for you it's going to provide You some kind of infrastructure some kind of way to communicate with the Package an API a set of interfaces called what you want so you can kind of have a contract with this package and Say I want the customers here you go here's the customers whatever you want to do right so that's why we're going to use a class library but they're two Different ones we can pick now we can pick the class library that's built for dublin core very specifically for dotnet core and that gives you some pretty cool extension some pretty cool things you could do with the dotnet core framework but there's also another one called the dotnet standard library that's a multi-platform that's something that you can use in other frameworks you can use it for instance in dotnet core like we're doing sweet but in the old frameworks as well meaning that if you for some reason decide that you want to downgrade to the old framework you can Actually still use this core setup of the heart of our application right here inside the old frameworks as well now this is pretty amazing because that means that we could do the other way Around as well right if we if we picked up the standard to build a framework in the old setup we could actually have moved to that net core without making any changes to anything except the outer Layers like the new NT framework or Instead of the old entity framework for the old set up right here but you can Also use it for model develop which is a way for use for using on Mac machines for instance you can use force a marine which is way to develop and well apps and stuff like that you can use it for the Windows platform which is a way to build applications for your desktop we can use it for Windows Phone stuff like that so we can if we make and use a standard library we'll use we'll lose some of the dotnet core power but we'll get the possibility to actually reuse our core code everything in the center of our Application we can use that on another platform later on if we want to that's Amazing so we're going to try and do That it means that some things that we're used to might not be available in the standard if we were used to dotnet core but it also means that it's Reusable for the future right so it's Kind of future proof but again if you don't want to do that it's ok to just go for the dotnet core no problem for me so I'm going to use the standard library For that reason going in here picking doublets that a library it's on a multi-platform app if you can't find it dotnet standard library whoops library Sorry there we go dotnet standard library there we go I'll say next I'll Use Totten a to standard now that's actually the status you see out here and I'll say next and then I'll call it let's just stop by customer app so I Know that this is my customer app Project or customized solution that I'm Going to build in my case and then I'm Going to call it core because this is For the center of my the heart of my application right the core architecture layer right here and then the final one is going to be called entity now the Reason that I want a project for the entities is maybe in some of the other Projects I only need the entities I don't need the entire domain service and application service so that's why I want project for the entities on their own I'm going to create this guy under the solution that I have already there we go and now I have my first class right here let's just delete that guy and just add a customer class delete remember not remove from project but delete I want to remove it completely from the solution I'll add a new class right here we could just copy this guy but then I would have to rename and do stuff like that I don't want to do that yet so I'll just make a new file call it customer going to be an Empty customer going to be a simple empty class right here I'm going to say new there we go we have our customer I'm just going to do like in the previous video and just copy the different attributes that I need right here dude there we go now we have all there that we need for now inside our customer core have a kiss right here Swede so that's all I have to do for now see you next lesson where we'll have even more fun.

واژگان شبکه مترجمین ایران


معنی‌های پیشنهادی کاربران

نام و نام خانوادگی
شماره تلفن همراه
متن معنی یا پیشنهاد شما
Captcha Code